﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="WebUI.Pages.UserList" MasterPageFile="~/MasterPage/Default.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="cphMain">
    <h3>Danh sách người sử dụng</h3>
 <asp:GridView runat="server" ID="grvUserList" AutoGenerateColumns="False" 
        CellPadding="0" CellSpacing="0" ForeColor="#333333" GridLines="Vertical" Width="50%"
        OnRowCreated="grvUserList_RowCreated"
        OnRowDataBound="grvUserList_RowDataBound"
 >
    <Columns>
        <asp:TemplateField>
            <ItemStyle Width="16" />
                <ItemTemplate>
                    <input type="checkbox" name="chkSelect" />
                </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField HeaderText="Username" DataField="Username" />
        <asp:BoundField HeaderText="Password" DataField="Password" />
        <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
            <ItemTemplate>
                <asp:LinkButton runat="server" Text="Edit" ForeColor="Blue" Font-Size="8pt" 
                    CommandName="EditUser" CommandArgument='<%#Eval("ID")%>'/> 
                <asp:LinkButton runat="server" Text="Delete" ForeColor="Blue" Font-Size="8pt" 
                    CommandName="DeleteUser" CommandArgument='<%#Eval("ID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
 </asp:GridView> 
 
 <script language="javascript" type="text/javascript">       
        function selectAll(id)
        {
            var value=document.getElementById(id).checked;
            var chkGroup = document.getElementsByName('chkSelect');
            for(i=0;i<chkGroup.length;i++)
            {
                chkGroup[i].checked=value;
            }
        }        
</script>
 
</asp:Content>
